import { requestClient } from '#/api/request';

/**
 *  获取成品列表
 */
async function getScmGoodsList(params: any) {
  return requestClient.get('/admin/ScmGoods/index', params);
}
/**
 *  获取成品列表
 */
async function styleTree(params: any) {
  return requestClient.get('/admin/GoodsStyleCategory/styleTree', params);
}
/**
 *  获取货品分类检索项目
 */
async function allIndex(params: object = {}) {
  return requestClient.get('/admin/GoodsCategory/allIndex', params);
}
/**
 *  获取裁床sku列表
 */
async function getTreeAll(params: object = {}) {
  return requestClient.get('/admin/GoodsTimeCategory/getTreeAll', params);
}

/**
 *  获取货品分析信息检索项目
 */
async function categoryTree(params: any) {
  return requestClient.get('/admin/GoodsStyleCategory/categoryTree', params);
}

/**
 *  停用启用
 */
async function setStatus(params: any) {
  return requestClient.post('/admin/ScmGoods/setStatus', params);
}

/**
 *  推送erp
 */
async function syncErp(params: any) {
  return requestClient.post('/admin/ScmGoods/syncErp', params,{responseReturn:"raw"});
}

/**
 *  导出
 */
async function goodsExcelOut(params: any) {
  return requestClient.post('/admin/GoodsExcel/goods_excel_out', params);
}

/**
 *  导出
 */
async function goodsIngrImages(params: any) {
  return requestClient.post('/admin/GoodsExcel/goods_ingr_images', params);
}

/**
 *  获取远程选项-简码
 */
async function remoteSelect(params: any) {
  return requestClient.get('/admin/template/remoteSelect', params);
}

/**
 *  获取远程选项-颜色
 */
async function colorAll(params: any) {
  return requestClient.get('/admin/Color/all', params);
}

/**
 *  获取远程选项-品牌
 */
async function ErpBrandList(params: any) {
  return requestClient.get('/admin/erp.ErpBrandInfo/selectList', params);
}

/**
 *  获取数据字典
 */
async function DictAddInit(params: any) {
  return requestClient.post('/admin/Dict/addInit', params);
}
/**
 *  获取货品详细
 */
async function ScmGoodsInfo(params: any) {
  return requestClient.get('/admin/ScmGoods/edit', params,);
}

/**
 *  获取尺码组
 */
async function getSizeGroupList(params: any) {
  return requestClient.post('/admin/sizeGroup/getList', params);
}

/**
 *  获取远程选项一级风格
 */
async function getGoodsStyleCategory(params: any) {
  return requestClient.get('/admin/GoodsStyleCategory/selectItem', params);
}

/**
 *  获取色系
 */
async function colorSeriesTree(params: object = {}) {
  return requestClient.get('/admin/colorSeries/colorSeriesTree', params);
}
/**
 *  获取供应商列表
 */
async function getFactoryIndex(params: object = {}) {
  return requestClient.get('/admin/Factory/index', params );
}

/**
 *  获取检测文件列表
 */
async function getAttachmentList(params: object = {}) {
  return requestClient.get('/admin/routine.attachment/index', params);
}

/**
 *  保存
 */
async function ScmGoodsEdit(params: any) {
  return requestClient.post('/admin/ScmGoods/edit', params,{ responseReturn: 'raw' });
}

/**
 *  新增
 */
async function ScmGoodsAdd(params: any) {
  return requestClient.post('/admin/ScmGoods/add', params ,{ responseReturn: 'raw' });
}
/**
 *  获取检测文件列表
 */
async function getTypeOptions(params: any) {
  return requestClient.get('/admin/ProductBatchOrder/getTypeOptions', params);
}

/**
 *  获取品类
 */
async function userCategorys(params: any) {
  return requestClient.get('/admin/auth.admin/user_categorys', params);
}

/**
 *  获取动态字段
 */
async function getAttachFiled(params: any) {
  return requestClient.post('/admin/ScmGoods/getAttachFiled', params);
}

/**
 *  创建简码
 */
async function fastAdd(params: any) {
  return requestClient.post('/admin/v2.template/fastAdd', params, { responseReturn: 'raw' })
}

/**
 *  编辑简码
 */
async function fastEdit(params: any) {
  return requestClient.post('/admin/v2.template/fastEdit', params, { responseReturn: 'raw' })
}

/**
 *  查询品类对应默认rfid配置
 */
async function queryDefaultRfidOptions(params: any) {
  return requestClient.post('/admin/v2.Goods/queryDefaultRfidOptions', params, { responseReturn: 'raw' })
}


export {
  queryDefaultRfidOptions,
  allIndex,
  categoryTree,
  colorAll,
  colorSeriesTree,
  DictAddInit,
  ErpBrandList,
  fastAdd,
  fastEdit,
  getAttachFiled,
  getAttachmentList,
  getFactoryIndex,
  getGoodsStyleCategory,
  getScmGoodsList,
  getSizeGroupList,
  getTreeAll,
  getTypeOptions,
  goodsExcelOut,
  goodsIngrImages,
  remoteSelect,
  ScmGoodsAdd,
  ScmGoodsEdit,
  ScmGoodsInfo,
  setStatus,
  styleTree,
  syncErp,
  userCategorys,
};
